<?php
class LoginForm extends Zend_Form {
    public function __construct($options = null) 
    {
    	$baseurl = new MHDEV_View_Helper_BaseUrl();
    	
        parent::__construct($options);
        
        $this->setName('login');
        
        // Username
        $username = new Zend_Form_Element_Text('username');
        $username->setLabel(Zend_Registry::get('lang')->_('login_mail'));
        $username->setRequired(true);
        $username->setErrorMessages(array(
            0 => Zend_Registry::get('lang')->_('error_login_mail')
        ));
        
        // Password
        $password = new Zend_Form_Element_Password('password');
		$password->setLabel(Zend_Registry::get('lang')->_('login_password'));
		$password->setRequired(true);
		$password->addFilter('StringTrim');
		$password->addValidator('NotEmpty');
		$password->setErrorMessages(array(
            0 => Zend_Registry::get('lang')->_('error_login_password'),
        ));
        
        // save login
        $save = new Zend_Form_Element_Checkbox('save');
        $save->setLabel(Zend_Registry::get('lang')->_('login_save'));
        $save->setDescription(Zend_Registry::get('lang')->_('login_dsave'));
        
        // Submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel(Zend_Registry::get('lang')->_('form_login'));

        $this->addElements(array($username, $password, $save, $submit));
    }
}  
?>